//
//  CloseMyTableViewCell.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/10/24.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "CloseMyTableViewCell.h"

@implementation CloseMyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.iconImageQM];
        [self.iconImageQM addSubview:self.headportraitButQM];
        [self.contentView addSubview:self.nameLabelQM];
        [self.contentView addSubview:self.attentionButQM];
        [self.contentView addSubview:self.djImageQM];
        [self.contentView addSubview:self.djLabelQM];
        [self.contentView addSubview:self.browseImageQM];
        [self.contentView addSubview:self.numLabelQM];
        
        [self setAdapterView];//位置
    }
    return self;
}
- (void)setAdapterView{
    
    //阴影
    _iconImageQM.sd_layout
    .topSpaceToView(self.contentView, kHeightScale(10))
    .leftSpaceToView(self.contentView, kWidthScale(15))
    .widthIs(kWidthScale(50))
    .heightIs(kHeightScale(50));
    
    _headportraitButQM.sd_layout
    .topSpaceToView(self.iconImageQM, kHeightScale(2.5))
    .leftSpaceToView(self.iconImageQM, kWidthScale(2.5))
    .widthIs(kWidthScale(45))
    .heightIs(kHeightScale(45));
    
    _nameLabelQM.sd_layout
    .topSpaceToView(self.contentView, kHeightScale(18))
    .leftSpaceToView(self.iconImageQM, kWidthScale(5))
    .widthIs(kWidthScale(120))
    .autoHeightRatio(0);
    
    _attentionButQM.sd_layout
    .centerYEqualToView(self.contentView)
    .rightSpaceToView(self.contentView, kWidthScale(15))
    .widthIs(kWidthScale(125/2))
    .heightIs(kHeightScale(45/2));
    
    _djImageQM.sd_layout
    .topSpaceToView(self.nameLabelQM, kHeightScale(5))
    .leftSpaceToView(self.iconImageQM, kWidthScale(5))
    .widthIs(kWidthScale(10))
    .heightIs(kHeightScale(10));
    
    _djLabelQM.sd_layout
    .centerYEqualToView(self.djImageQM)
    .leftSpaceToView(self.djImageQM, kWidthScale(5))
    .widthIs(kWidthScale(30))
    .autoHeightRatio(0);
    
    _browseImageQM.sd_layout
    .centerYEqualToView(self.djImageQM)
    .leftSpaceToView(self.djLabelQM, kWidthScale(10))
    .widthIs(kWidthScale(12))
    .heightIs(kHeightScale(11));
    
    _numLabelQM.sd_layout
    .centerYEqualToView(self.djImageQM)
    .leftSpaceToView(self.browseImageQM, kWidthScale(5))
    .widthIs(kWidthScale(100/2))
    .autoHeightRatio(0);
    
}

- (UIView *)iconImageQM
{
    if (!_iconImageQM)
    {
        _iconImageQM=[[UIView alloc] init];
        _iconImageQM.backgroundColor = [UIColor colorWithRed:(213.0/255) green:(213.0/255) blue:(213.0/255) alpha:1];
        _iconImageQM.layer.masksToBounds=YES;
        _iconImageQM.layer.cornerRadius=25;
        _iconImageQM.layer.shadowColor = [UIColor blackColor].CGColor;
        _iconImageQM.layer.shadowOffset = CGSizeMake(-3, 1);
        _iconImageQM.layer.shadowOpacity = 0.4;
        _iconImageQM.layer.shadowRadius = 2.0;
        _iconImageQM.clipsToBounds = NO;
    }
    return _iconImageQM;
}
- (UIButton *)headportraitButQM
{
    if (!_headportraitButQM)
    {
        _headportraitButQM= [[UIButton alloc] init];
        _headportraitButQM.layer.masksToBounds=YES;
        _headportraitButQM.layer.cornerRadius=kWidthScale(22.5);
        [_headportraitButQM setBackgroundImage:[UIImage imageNamed:@"1111"] forState:UIControlStateNormal];
    }
    return _headportraitButQM;
}
- (UILabel *)nameLabelQM
{
    if (!_nameLabelQM)
    {
        _nameLabelQM=[[UILabel alloc] init];
        _nameLabelQM.text=@"迪丽热巴";
        _nameLabelQM.textColor=[UIColor colorWithHexString:@"#333333"];
        _nameLabelQM.font=[UIFont systemFontOfSize:kWidthScale(15)];
    }
    return _nameLabelQM;
}
- (UIButton *)attentionButQM
{
    if (!_attentionButQM)
    {
        _attentionButQM=[[UIButton alloc] init];
        _attentionButQM.layer.borderWidth=1;
        _attentionButQM.layer.cornerRadius=kWidthScale(11);
        _attentionButQM.layer.borderColor=[UIColor colorWithRed:(193.0/255) green:(193.0/255) blue:(193.0/255) alpha:1].CGColor;
        [_attentionButQM setTitle:@"取消管路" forState:UIControlStateNormal];
        _attentionButQM.titleLabel.font=[UIFont systemFontOfSize:kWidthScale(11)];
        [_attentionButQM setTitleColor:[UIColor colorWithHexString:@"#999999"] forState:UIControlStateNormal];
        _attentionButQM.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return _attentionButQM;
}
- (UIImageView *)djImageQM
{
    if (!_djImageQM)
    {
        _djImageQM=[[UIImageView alloc] init];
        _djImageQM.image=[UIImage imageNamed:@"dengji1"];
        //_djImage.backgroundColor=[UIColor colorWithHexString:@"#999999"];
    }
    return _djImageQM;
}
- (UILabel *)djLabelQM
{
    if (!_djLabelQM)
    {
        _djLabelQM=[[UILabel alloc] init];
        _djLabelQM.text=@"100级";
        _djLabelQM.textColor=[UIColor colorWithHexString:@"#999999"];
        _djLabelQM.font=[UIFont systemFontOfSize:kWidthScale(10)];
    }
    return _djLabelQM;
}
- (UIImageView *)browseImageQM
{
    if (!_browseImageQM)
    {
        _browseImageQM=[[UIImageView alloc] init];
        _browseImageQM.image=[UIImage imageNamed:@"qinmi"];
    }
    return _browseImageQM;
}
- (UILabel *)numLabelQM
{
    if (!_numLabelQM)
    {
        _numLabelQM=[[UILabel alloc] init];
        _numLabelQM.text=@"100";
        _numLabelQM.textColor=[UIColor colorWithHexString:@"#999999"];
        _numLabelQM.font=[UIFont systemFontOfSize:kWidthScale(10)];
    }
    return _numLabelQM;
}

@end
